﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using NFine.Data.Entity.SystemManage;

namespace NFine.Data.Map.SystemManage
{
    public class RegionMap : IEntityTypeConfiguration<Region>
    {
        /// <summary>
        /// PassageCategories FluentAPI配置
        /// 
        /// 添加复合主键、配置多对多关系
        /// </summary>
        /// <param name="builder"></param>
        public void Configure(EntityTypeBuilder<Region> builder)
        {
            builder.Property(p => p.Longitude).HasColumnType("decimal(10,7)");
            builder.Property(p => p.Latitude).HasColumnType("decimal(10,7)");

            //配置过滤器
            //builder.HasQueryFilter(region => EF.Property<bool>(region, "DeletedMark") == false);
        }
    }
}
